package org.orbroker.callback

/**
 * Callback to serve as proxy for multiple callbacks.
 */
class MultiProxyCallback(delegates: ExecutionCallback*) extends ExecutionCallback {

  def onSQL(id: Symbol, sql: String, parms: Seq[Any], executionTime: Int) {
    for (delegate ← delegates)
      delegate.onSQL(id, sql, parms, executionTime)
  }

  def onSQLBatch(id: Symbol, sql: String, parms: Seq[Seq[Any]], executionTime: Int) {
    for (delegate ← delegates)
      delegate.onSQLBatch(id, sql, parms, executionTime)
  }

  def onWarning(warning: java.sql.SQLWarning) {
    for (delegate ← delegates)
      delegate.onWarning(warning)
  }

}
